package com.ruoyi.web.wx.controller;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.dddetails.service.IDdDetailsService;
import com.ruoyi.user.domain.User;
import com.ruoyi.user.domain.vo.UserVO;
import com.ruoyi.wx.utils.GetUserUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@Api(tags = "叮豆")
@RestController
@RequestMapping("/wx/ddDetails")
public class WxDdDetailsController {

    @Autowired
    private IDdDetailsService ddDetailsService;

    @ApiOperation("查询用户叮豆列表")
    @GetMapping("ddDetailsList")
    public AjaxResult ddDetailsList(HttpServletRequest request) {
        User user = GetUserUtils.getLoginUser(request);
        return AjaxResult.success(ddDetailsService.selectDdDetailsListByUserId(user.getUserId()));
    }
}
